#ifndef _KEY_VALUE_   
#define _KEY_VALUE_   
  
#ifdef __cplusplus   
extern "C"  
{   
#endif   

#define SEND_BUFFER_LEN 128
  
/***************************************************************************************************/
/*                                   protocal defined                                              */
/*     INT             INT             CMD           INT          PARAMETER1 ..... INT PARAMETERn*/
  /*Total len*/    /*cmd len*/    /*eg. hegit*/    /*para len*/   /*para */
/***************************************************************************************************/	

//for recv    
bool check_rsp_data_valid(char * rspbuf,int rsplen,char* cmd,int cmdlen,int * parse_len);
void get_parameter(int * parlen, char** par,char * rspbuf,int *parse_len);
int get_elem_len(char *buffer,int* parse_len);  

//for send 
void send_buffer_init(char ** buffer,int * total_len);
void add_cmd(char *cmd,int cmdlen,char *buffer,int * total_len); 
void add_elem(char *elem,int elemlen,int parbegin,char *buffer,int * total_len);   
  
#ifdef __cplusplus   
};   
#endif   
#endif //end of _KEY_VALUE_  
